//package MySQL;
//
//public class mysql2 {
//}
//
//
//Enter password: *********
//Welcome to the MySQL monitor.  Commands end with ; or \g.
//Your MySQL connection id is 12
//Server version: 8.0.39 MySQL Community Server - GPL
//
//Copyright (c) 2000, 2024, Oracle and/or its affiliates.
//
//Oracle is a registered trademark of Oracle Corporation and/or its
//affiliates. Other names may be trademarks of their respective
//owners.
//
//        Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
//
//mysql> use gxc
//Database changed
//mysql> select jsjdatetime from gy where bh = '3957136468' order by jsjdatetime desc limit 1;
//Empty set (0.00 sec)
//
//mysql> create index kcindex on sp (kc);
//Query OK, 0 rows affected (0.02 sec)
//Records: 0  Duplicates: 0  Warnings: 0
//
//mysql> select * from gy where bh = '8843172113' and jsjdatetime < '2004-01-01 00:00:00';
//Empty set (0.00 sec)
//
//mysql> select * from sp where kc > 100;;
//Empty set (0.00 sec)
//
//ERROR:
//No query specified
//
//mysql> select * from sp where kc > 100;;
//Empty set (0.00 sec)
//
//ERROR:
//No query specified
//
//mysql> select * from sp where kc > 100;
//Empty set (0.00 sec)
//
//mysql> use st;
//ERROR 1049 (42000): Unknown database 'st'
//mysql> show databases;
//+--------------------+
//        | Database           |
//        +--------------------+
//        | bit_mall           |
//        | exam               |
//        | exam2              |
//        | gxc                |
//        | homework           |
//        | information_schema |
//        | java113            |
//        | mysql              |
//        | performance_schema |
//        | student            |
//        | sys                |
//        | test               |
//        +--------------------+
//        12 rows in set (0.00 sec)
//
//mysql> use student;
//Database changed
//mysql> create view view1 as (select Stuno, Classno from sc where score is null);
//Query OK, 0 rows affected (0.01 sec)
//
//mysql> select * from view1;
//Empty set (0.00 sec)
//
//mysql> drop view view1;;
//Query OK, 0 rows affected (0.01 sec)
//
//ERROR:
//No query specified
//
//mysql> drop view view1;
//ERROR 1051 (42S02): Unknown table 'student.view1'
//mysql> create view view1 as (select Stuno, Classno from sc where score is null);
//Query OK, 0 rows affected (0.01 sec)
//
//mysql> drop view view1;
//Query OK, 0 rows affected (0.01 sec)
//
//mysql> use gxc;
//Database changed
//mysql> create index spindex on sp(mc);
//Query OK, 0 rows affected (0.02 sec)
//Records: 0  Duplicates: 0  Warnings: 0
//
//mysql> drop index spindex;
//ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
//mysql> drop spindex;
//ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'spindex' at line 1
//mysql> drop index spindex;
//ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
//mysql> drop index spindex(mc);
//ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(mc)' at line 1
//mysql> select * from sp;
//+------------+----------------------------------+------------+------+----+
//        | bh         | mc                               | xkc        | sj   | kc |
//        +------------+----------------------------------+------------+------+----+
//        | 0401140733 | 米奇的复仇                       | 2001-12-12 |   22 | 33 |
//        | 1059831198 | 一天中10分钟的身体成分           | 2001-01-21 |   31 | 32 |
//        +------------+----------------------------------+------------+------+----+
//        2 rows in set (0.00 sec)
//
//mysql> select * from sp;
//+------------+----------------------------------+------------+------+-----+
//        | bh         | mc                               | xkc        | sj   | kc  |
//        +------------+----------------------------------+------------+------+-----+
//        | 0132149871 | 如何最快的制作比萨               | 2002-11-11 |   31 |  32 |
//        | 0299282519 | 烹饪之路                         | 2000-09-11 |   28 |  78 |
//        | 0401140733 | 米奇的复仇                       | 2001-12-12 |   22 |  33 |
//        | 1059831198 | 一天中10分钟的身体成分           | 2001-01-21 |   31 |  32 |
//        | 1915762492 | 电脑手册                         | 2001-01-21 |   25 | 105 |
//        | 2147428890 | 最短小精悍的诗                   | 2001-05-01 |   31 | 154 |
//        | 2491748320 | 教育孩子_轻松方法                | 2000-07-17 |   90 | 140 |
//        | 3437212490 | 用蘑菇烹饪                       | 2002-02-18 |   20 | 105 |
//        | 3957136468 | 数据库法宝                       | 2001-11-30 |   75 |  49 |
//        | 4981341710 | 用牙签造车                       | 2002-08-18 |   59 |  35 |
//        | 8117949391 | 大熊和小宝贝                     | 2001-11-08 |   90 | 105 |
//        | 8843172113 | 数据库的实现                     | 1999-06-04 |   55 | 100 |
//        | 9247381001 | 如何成为经理人                   | 1999-05-09 |   32 | 100 |
//        | 9959789321 | 电子商务的道路                   | 2001-03-02 |   54 |  61 |
//        +------------+----------------------------------+------------+------+-----+
//        14 rows in set (0.00 sec)
//
//mysql> select * from gy;
//+------+------------+----+---------------------+
//        | ddh  | bh         | ls | jsjdatetime         |
//        +------+------------+----+---------------------+
//        | 1000 | 3437212490 |  1 | 2003-03-31 00:00:00 |
//        | 1001 | 3957136468 |  1 | 2003-03-31 00:00:00 |
//        +------+------------+----+---------------------+
//        2 rows in set (0.00 sec)
//
//mysql>
//
//create table if not exists sp (
//        bh char(10) primary key,
//mc varchar(50) not null,
//xkc date,
//sj decimal,
//kc real not null
//        );
//
//create table if not exists gy (
//        ddh char(10) primary key,
//bh char(20) not null,
//ls float not null,
//jsjdatetime datetime default CURRENT_TIMESTAMP,
//foreign key (bh) references sp (bh)
//        );
//
//insert into sp values ('1059831198', '一天中10分钟的身体成分', '2001-1-21', 30.95, 32);
//insert into sp values ('0401140733', '米奇的复仇', '2001-12-12', 22, 33);
//insert into sp values ('4981341710', '用牙签造车', '2002-8-18', 59, 35);
//insert into sp values ('8843172113', '数据库的实现', '1999-6-4', 55, 100);
//insert into sp values ('3437212490', '用蘑菇烹饪', '2002-2-18', 19.95, 105);
//insert into sp values ('3957136468', '数据库法宝', '2001-11-30', 75, 49);
//insert into sp values ('1915762492', '电脑手册', '2001-1-21', 25, 105);
//insert into sp values ('9959789321', '电子商务的道路', '2001-3-2', 54, 61);
//insert into sp values ('2491748320', '教育孩子_轻松方法', '2000-7-17', 89.95, 140);
//insert into sp values ('0299282519', '烹饪之路', '2000-9-11', 28, 78);
//insert into sp values ('8117949391', '大熊和小宝贝', '2001-11-8', 89.95, 105);
//insert into sp values ('0132149871', '如何最快的制作比萨', '2002-11-11', 30.95, 32);
//insert into sp values ('9247381001', '如何成为经理人', '1999-5-9', 31.95, 100);
//insert into sp values ('2147428890', '最短小精悍的诗', '2001-5-1', 30.95, 154);
//
//
//insert into gy values ('1000', '3437212490', 1, '2003-3-31');
//insert into gy values ('1001', '3957136468', 1, '2003-3-31');
//insert into gy values ('1001', '2491748320', 1, '2003-3-31');
//insert into gy values ('1002', '8843172113', 2, '2003-4-1');
//insert into gy values ('1003', '1059831198', 1, '2003-4-1');
//insert into gy values ('1003', '3437212490', 1, '2003-4-1');
//insert into gy values ('1003', '3437212490', 1, '2003-4-1');
//insert into gy values ('1004', '2491748320', 2, '2003-4-1');
//insert into gy values ('1005', '2147428890', 1, '2003-4-2');
//insert into gy values ('1006', '8843172113', 1, '2003-4-3');
//insert into gy values ('1007', '3957136468', 3, '2004-4-3');
//insert into gy values ('1007', '8843172113', 1, '2005-4-3');
//
//create table if not exists st (
//        sno char(8) not null primary key,
//sname varchar(20) not null,
//sex char(2) not null,
//sbirth datetime,
//check(sex = '男' or sex = '女')
// );
//
//drop table if exists st;
//
//
//create table if not exists sc (
//        Stuno char(8) not null,
//Classno varchar(30) not null primary key,
//score real,
//foreign key (Stuno) references st (sno)
//        );
//
//drop table sc;
//
//insert into st values ('05001', '张三', '男', '1988-12-12');
//insert into st values ('05002', '李四', '女', '1987-6-5');
//insert into st values ('05003', '王五', '女', '1987-12-1');
//insert into st (sno, sname, sex) values ('05004', '赵六', '女');
//insert into st values ('05005', '张欣', '男', '1988-4-1');
//insert into st values ('05006', '李杰', '男', '1988-7-3');
//
//insert into sc values ('05001', '001', 95);
//insert into sc values ('05001', '002', 90);
//insert into sc values ('05001', '003', 88);
//insert into sc (Stuno, Classno) values ('05002', '001');
//insert into sc values ('05002', '002', 93);
//insert into sc values ('05002', '003', 88);
//insert into sc values ('05003', '001', 95);
//insert into sc values ('05003', '002', 73);
//insert into sc values ('05003', '003', 58);
//insert into sc values ('05004', '001', 47);
//insert into sc values ('05004', '003', 61);
//insert into sc values ('05005', '002', 59);
//insert into sc values ('05005', '003', 47);
//insert into sc (Stuno, Classno) values ('05006', '001');
//insert into sc values ('05006', '002', 92);